Skip to content

Added string arrays to simple binding #63072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StickFun
Copy link

@StickFun StickFun commented Aug 2, 2025

Added string arrays to simple binding

Description

Fixed condition for using a string array with simple binding.

Fixes #62326

@github-actions github-actions bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Aug 2, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 2, 2025
Copy link
Contributor

Thanks for your PR, @@StickFun. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@captainsafia captainsafia added area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions labels Aug 3, 2025
Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks like a good start -- can you add some test coverage to RequestDelegateFactoryTests in the repo for this case?

@captainsafia captainsafia added the pr: pending author input For automation. Specifically separate from Needs: Author Feedback label Aug 3, 2025
@StickFun
Copy link
Author

StickFun commented Aug 3, 2025

Added unit test for handling string array

metadata.Name == "formValues") as ParameterBindingMetadata;

Assert.NotNull(parameterBindingMetadata);
Assert.Equal(typeof(string[]), parameterBindingMetadata.ParameterInfo.ParameterType);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update the test to send a payload in the HTTP context and verify that context.Items["form"] is populated correctly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc community-contribution Indicates that the PR has been added by a community member pr: pending author input For automation. Specifically separate from Needs: Author Feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InvalidOperationException when using string[] parameters with FromForm attribute
2 participants